/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.dew.proyecto.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author U921344
 */
public class LoginServlet extends HttpServlet {
   

    /** 
     * Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {

        System.out.println("Entro a doPost");
        
        // se recupera la data ingresada en los textboxes
        String usuario = request.getParameter("usuario");
        
        request.getRequestDispatcher("bienvenida.jsp").forward(request,response);
        /* lee variables del view */
        String password = request.getParameter("password");
        /*pasa parametros al view*/


/*
        Usuario user = new Usuario();
        user.setUsername(usuario);
        user.setPassword(password);
        

        System.out.println("usuario --> " + usuario);
        System.out.println("password --> " + password);
        
*/

    }


}
